﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wekit.Web.Security;
using System.Web.Security;
namespace Wekit.Web.Services
{
    public class FormsAuthenticationService : IFormsAuthenticationService
    {
        public IPrincipalService PrincipalService { get; set; }

        /// <summary>
        /// 用户登录函数
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="createPersistentCookie"></param>
        public void SignIn(string userName, bool createPersistentCookie)
        {
        
            FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
        }

        /// <summary>
        /// 用户注销函数
        /// </summary>
        public void SignOut()
        {
            FormsAuthentication.SignOut();
        }


        public bool isUserInRole(Model.Auth.User user, Model.Auth.Role role)
        {
            throw new NotImplementedException();
        }
    }
}
